package org.ldx.lotterysystem.service.enums;

import lombok.Getter;

/**
 * 用来限制活动状态的枚举
 */
@Getter
public enum ActivityStatusEnum {
    RUNNING(1,"活动进行中"),
    COMPLETE(2,"活动已完成");

    private final Integer code;
    private final String message;


    ActivityStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ActivityStatusEnum forName(String name){
        for(ActivityStatusEnum activityStatusEnum:ActivityStatusEnum.values()){
            if(activityStatusEnum.name().equalsIgnoreCase(name)){
                return activityStatusEnum;
            }
        }
        return null;
    }

}
